package com.yitao.client.constant;


/**
 * Function:
 * Date: 2018/11/20
 *
 * @author skipper
 * @desc 放置枚举字段
 * @see
 */
public abstract class BaseConstant {


    public static final String SESSION_USER = "YI_TAO_USER";

    public static final String CMS_SESSION_USER = "CMS_YI_TAO_USER";

    public static final Integer SESSION_MAX_TIME = 60 * 10;

    public static final Integer SESSION_USER_MAX_TIME = 60 * 60 * 24 * 30; // 登录用户过期时间,一个月

    public static final Integer FEEDBACK_CONTENT_MAX_LENGTH = 200;

    /**
     * 商城订单编号开头
     */
    public static final String MALL_ORDER_CODE_HEADER = "M";

    /**
     * 商品编号开头
     */
    public static final String PRODUCT_CODE_HEADER = "P";

    /**
     * 商品SKU编号开头
     */
    public static final String SKU_CODE_HEADER = "S";

    /**
     * 商城分类编号开头
     */
    public static final String CATEGORY_CODE_HEADER = "C";


    /**
     * 用户状态相关枚举
     */
    public enum UserTypeEnum {
        //普通用户
        GENERAL("1"),
        //VIP 用户
        VIP("2"),
        // 店铺注册用户
        SYNCHRONIZATION_SHOP("3");

        private final String code;


        UserTypeEnum(String code) {
            this.code = code;

        }

        public String getCode() {
            return code;
        }

    }





    /**
     * 1：加1 2：减1
     *
     */
    public enum AddOrMinusTypeEnum{
        ADD(1),
        MINUS(2);

        private final Integer code;

        AddOrMinusTypeEnum(Integer code) {
            this.code = code;

        }
        public Integer getCode() {
            return code;
        }
    }

    public enum IsDelete {
        NO(0, "未删除"), YES(1, "已删除");

        private final Integer code;
        private final String msg;

        IsDelete(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }
        public Integer getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }
    }

    /**
     * 是否默认
     */
    public enum IsDefault {
        NO(0, "否"), YES(1, "是");

        private final Integer code;
        private final String msg;

        IsDefault(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }
        public Integer getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }
    }

    /**
     * 是否有效
     */
    public enum StateEnum{
        INVALID(0, "无效"),
        EFFECTIVE(1, "有效");

        private Integer code;
        private String msg;

        StateEnum(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }
        public Integer getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }
    }
}
